/* ====================================== 模块子路由配置  ====================================== */
import React from 'react'
import { Route, Redirect, Switch } from 'react-router-dom'
// ===================================================================== 异步加载
import Import from '@com/lazy/lazy-router'
// ===================================================================== 路由配置
import Workbench from '@views/workbench/main'
import laboratoryManage from '@views/laboratory-manage'
import TestingCenter from '@views/testing-center'
// ===================================================================== 同步路由
const Index = ({ match }) => {
	const { url } = match
	return (
		<Switch>
			<Route 	path={`${url}/workbench`} 			component={ Workbench }  />
			<Route 	path={`${url}/laboratory-manage`} 	component={ laboratoryManage }  />
			<Route 	path={`${url}/testing-center`} 		component={ TestingCenter }  />
			{/* 重定向 */}
			<Route path={url} children={<Redirect to={`${url}/workbench/index`} />}  />
			{/* 404 */}
			<Route component={ Import('404') } />
		</Switch>
	)
}

export default Index